package com.yumeko.controller;

import com.yumeko.entity.TAccount;
import com.yumeko.service.TAccountService;
import com.yumeko.utils.ResponseData;
import feign.Response;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * (TAccount)表控制层
 *
 * @author Zheng Hao
 * @since 2020-03-20 20:53:58
 */
@RestController
public class TAccountController {
    /**
     * 服务对象
     */
    @Resource
    private TAccountService tAccountService;


    @PostMapping("account/decrease")
    public ResponseData decrease(@RequestParam("userId") Long userId,
                                 @RequestParam("money") BigDecimal money) {
        tAccountService.decrease(userId, money);
        return new ResponseData(200, "扣减账户余额成功");
    }
}